#!/usr/bin/env python
# -*- coding:utf-8 -*-

from flask_restful import Api

from . import apikey_blueprint
from api_1_0.apiKeyResource.apiKeyResource import ApiKeyResource
from api_1_0.apiKeyResource.apiKeyOtherResource import ApiKeyOtherResource

api = Api(apikey_blueprint)

api.add_resource(ApiKeyResource, '/apiKey/<key_id>', '/apiKey', endpoint='ApiKey')


@apikey_blueprint.route('/api-key-add', methods=['POST'], endpoint='ApiKeyAdd')
def add_api_key():
    return ApiKeyOtherResource.add_api_key()


@apikey_blueprint.route('/api-key-change', methods=['POST'], endpoint='ApiKeyChange')
def change_api_key():
    return ApiKeyOtherResource.change_api_key()


@apikey_blueprint.route('/api-key-delete/<key_id>', methods=['DELETE'], endpoint='ApiKeyDelete')
def delete_api_key(key_id):
    return ApiKeyOtherResource.delete_api_key(key_id)


@apikey_blueprint.route('/chat-model', methods=['GET'], endpoint='GetChatModel')
def get_current_model():
    return ApiKeyOtherResource.get_current_model()


@apikey_blueprint.route('/chat-model-list', methods=['GET'], endpoint='GetChatModelList')
def get_model_list():
    return ApiKeyOtherResource.get_model_list()
